1. Field of the Invention
The present invention relates to a rank order filter used with an image processing apparatus, an audio processing apparatus, etc., for determining the maximum value, the minimum value and the median value among a plurality of input digital values (sample values).
2. Description of Related Art
Rank order filtering is widely used in image processing systems, audio processing systems, etc. In this process, a one-dimensional or multi-dimensional signal having discrete sample values is inputted and smoothed in nonlinear fashion. Specifically, a plurality of (N) sample values are applied to a rank order filter, and only nth (1.ltoreq.n.ltoreq.N) lower one of the N sample values is selectively output. In the process, n is the rank order of the rank order filter.
In the case where n is (N+1)/2, the median value is selected from the N sample values. In this case, the rank order filter is referred to as the median value filter. Also, when n is N, the maximum value is selected from the N sample values, in which case the rank order filter is called the maximum value filter. Further, when n is 1, the minimum value is selected from the N sample values, and the rank order filter is called the minimum value filter.
In the case where the central value filter is used, the short-term discontinuous component generated suddenly tends to be removed by this filter, and the use of the central value filter is effective in reducing the very short-term noises from the signal processed. Also, the maximum value filter is effectively used for removing the noise which assume small values among a plurality of input sample values. Further, the minimum value filter is used effectively to eliminate the noises of large values from among a plurality of input sample values.
Digital two-dimensional image data are input sequentially by raster scan from the upper left corner of the screen 51 as shown in FIG. 1. With respect to this input image, as shown in FIG. 1, a given pixel is designated as a center pixel (coordinate (h, v)) and the neighboring eight pixels along three columns (vertical) and three rows (horizontal) of pixels covering a total of 3.times.3 pixels are set as a local area. The sample values of these nine pixels are subjected to rank order filtering. In FIG. 1, the 3.times.3 local area is specifically comprised of nine pixels indicated by coordinates (h-1, v-1), (h, v-1), (h+1, v-1), (h-1, v), (h, v), (h+1, v), (h-1, v+1), (h, v+1), (h+1, v+1). The sample values (density values) of these nine pixels are applied to the rank order filter, and rearranged in descending order of magnitude, so that the nth lower sample value,. (such as the median value, the maximum value or the minimum value) are selectively output, as described above.
In conventional rank order filters, only after all sample values are compared, they are rearranged in descending order of magnitude. As a result, rearrangement of nine sample values, for example, needed about .sub.9 C.sub.2 (=36) combinations of comparisons. For realizing this comparison operation with a digital circuit, 36 magnitude comparators are used for making a comparison by each comparator, or each of a smaller number of magnitude comparators is required to perform a plurality of comparisons. Thus, the conventional rank order filters posed the problem of a larger circuit scale and a low processing speed.